import { createContext, useContext } from "react";

interface Languages {
    "zh-CN": Record<string, string>;
}

const languages: Languages = {
    "zh-CN": {
        "ONI World Generator": "缺氧世界生成器",
        "Worldgen Seed": "世界种子",
        Reroll: "刷新",
        Copy: "复制",
        "Toggle to Light mode": "切换到浅色模式",
        "Toggle to Dark mode": "切换到暗黑模式",
        "Open on GitHub": "在GitHub上查看源码",
        Settings: "设置",
        Submit: "提交",
        "Scramble DLCs": "DLC混搭",
        Disable: "禁用",
        Enable: "启用",
        Likely: "可能",
        Guaranteed: "确保",
        "Game Mode": "游戏模式",
        "Base Game": "本体",
        Classic: "经典",
        "Spaced Out!": "眼冒金星",
        Asteroid: "小行星",
        "Planetoid Cluster": "小行星星群",
        "Moonlet Cluster": "卫星星群",
        Terra: "类地星体",
        Oceania: "海洋星体",
        Rime: "冰霜星体",
        Verdante: "翠绿星体",
        Arboria: "乔木星体",
        Volcanea: "火山星体",
        "The Badlands": "荒芜之地",
        Aridio: "干热星体",
        Oasisse: "绿洲星体",
        Ceres: "谷神星",
        "Blasted Ceres": "炸裂的谷神星",
        Relica: "古迹星",
        RelicAAAAGH: "古迹啊啊啊嗷星",
        "Terra Cluster": "类地星群",
        "Oceania Cluster": "海洋星群",
        "Squelchy Cluster": "泥泞星群",
        "Rime Cluster": "冰霜星群",
        "Verdante Cluster": "翠绿星群",
        "Arboria Cluster": "乔木星群",
        "Volcanea Cluster": "火山星群",
        "The Badlands Cluster": "荒芜星群",
        "Aridio Cluster": "干热星群",
        "Oasisse Cluster": "绿洲星群",
        "Ceres Cluster": "谷神星星群",
        "Blasted Ceres Cluster": "炸裂的谷神星星群",
        "Relica Cluster": "古迹星星群",
        "RelicAAAAGH Cluster": "古迹啊啊啊嗷星星群",
        "Terrania Cluster": "砂土星群",
        "Ceres Minor Cluster": "小谷神星星群",
        "Relica Minor Cluster": "小古迹星星群",
        "Folia Cluster": "绿叶星群",
        "Quagmiris Cluster": "泥潭星群",
        "Moonlet Cluster - Metallic Swampy": "卫星星群 - 金属沼泽",
        "Moonlet Cluster - The Desolands": "卫星星群 - 荒凉",
        "Moonlet Cluster - Frozen Forest": "卫星星群 - 冰冻森林",
        "Moonlet Cluster - Flipped": "卫星星群 - 倒置",
        "Moonlet Cluster - Radioactive Ocean": "卫星星群 - 放射性海洋",
        "Moonlet Cluster - Ceres Mantle": "卫星星群 - 谷神星地幔",
        "Relica Fragment": "古迹星碎片",
        "Wetlands Biome": "险沼生态",
        "Feather Biome": "寒羽生态",
        "Garden Biome": "花园生态",
        "The Prehistoric Planet Pack": "史前行星包",
        "The Bionic Booster Pack": "仿生增幅包",
        "Ceres Fragment": "谷神星碎片",
        "Nectar Biome": "花蜜生态",
        "Cool Pool Biome": "冷池生态",
        "Ice Cave Biome": "冰窟生态",
        "The Frosty Planet Pack": "寒霜行星包",
        "Cool Steam Vent": "低温蒸汽喷孔",
        "Steam Vent": "蒸汽喷孔",
        "Water Geyser": "清水泉",
        "Cool Slush Geyser": "低温泥浆泉",
        "Polluted Water Vent": "污水泉",
        "Cool Salt Slush Geyser": "低温盐泥泉",
        "Salt Water Geyser": "盐水泉",
        "Minor Volcano": "小型火山",
        Volcano: "火山",
        "Carbon Dioxide Geyser": "二氧化碳泉",
        "Carbon Dioxide Vent": "二氧化碳喷孔",
        "Hydrogen Vent": "氢气喷孔",
        "Hot Polluted Oxygen Vent": "高温污氧喷孔",
        "InFectious Polluted Oxygen Vent": "含菌污氧喷孔",
        "Chlorine Gas Vent": "氯气喷孔",
        "Natural Gas Geyser": "天然气喷孔",
        "Copper Volcano": "铜火山",
        "Iron Volcano": "铁火山",
        "Gold Volcano": "金火山",
        "Aluminum Volcano": "铝火山",
        "Cobalt Volcano": "钴火山",
        "Leaky Oil Fissure": "渗油裂缝",
        "Liquid Sulfur Geyser": "液硫泉",
        "Cool Chlorine Gas Vent": "低温氯气喷孔",
        "Tungsten Volcano": "钨火山",
        "Niobium Volcano": "铌火山",
        "Printing Pod": "打印舱",
        "Secondary Asteroid Base": "副星基地",
        "Oil Reservoir": "储油石",
        "Supply Teleporter Output": "供给传送器输出端",
        "Supply Teleporter Input": "供给传送器输入端",
        "Teleporter Transmitter": "传送发射/接收器",
        "Cryotank 3000": "低温箱3000",
        "No Traits": "没有不寻常的特质",
        "Crashed Satellites": "坠毁的卫星群",
        "Frozen Friend": "冰封之友",
        "Irregular Oil": "不规则原油区",
        "Lush Core": "繁茂核心",
        "Metallic Caves": "金属洞穴",
        "Radioactive Crust": "放射性地壳",
        "Subsurface Ocean": "地下海洋",
        "Volcanic Activity": "火山活跃",
        "Large Boulders": "大型石块",
        "Medium Boulders": "中型石块",
        "Mixed Boulders": "混合型石块",
        "Small Boulders": "小型石块",
        "Trapped Oil": "被圈闭的原油",
        "Frozen Core": "冰冻核心",
        Geoactive: "活跃性地质",
        Geodes: "晶洞",
        Geodormant: "休眠性地质",
        "Large Claciers": "大型冰川",
        "Magma Channels": "岩浆通道",
        "Metal Poor": "金属贫瘠",
        "Metal Rich": "金属富足",
        "Alternate Pod Location": "备选的打印舱位置",
        "Slime Molds": "粘液菌团",
        "Initializing, please wait a moment.": "正在初始化, 请稍候...",
    },
};

export const LanguageContext = createContext("zh-CN");
export const useTranslation = () => {
    const language = useContext(LanguageContext);
    return (key: string) => {
        switch (language) {
            case "zh-CN": {
                const chinese = languages["zh-CN"];
                if (key in chinese) return chinese[key];
                break;
            }
        }
        return key;
    };
};

export default useTranslation;
